#ifndef ROBINSONMATRIXIHM_H
#define ROBINSONMATRIXIHM_H

#include "../ui_robinsonmatrixihm.h"

#include "Matrix.h"

#include <QtGui/QWidget>
#include <vector>
#include <string>

namespace RobinsonMatrixIHM
{
	class RobinsonMatrixIHM : public QWidget
	{
	    Q_OBJECT
	
	public:
	    RobinsonMatrixIHM(QWidget *parent = 0);
	    ~RobinsonMatrixIHM();
	    
	    
	protected slots:
		void exec();
		void loadMatrix();
		QString fileOpen();
		void resize();
		void setValue(int i, int j);
		void randomMatrix();
		void fillManualy();
	    void randomGen();
		void clean();
		void showMatrix(const Matrix &m, std::vector<std::vector<QColor* > > colors, QTableWidget *t);
		void initColorsMatrix();
		std::vector<std::vector<QColor* > > permuteMatrix(std::vector<std::vector<QColor* > > colors, std::vector<unsigned int> &order);
		
	private:
	    Ui::RobinsonMatrixIHMClass ui;	
	    Matrix _dissimilarityMatrix;
	    Matrix _robinsonMatrix;
	    std::vector<unsigned int> _totalOrder;
	    std::vector<std::vector<QColor*> > _colors;
	    double _delta;
		
	};
}

#endif // ROBINSONMATRIXIHM_H
